package com.xmg.boot.demo.bootlesson1.user.mapper.dm;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmg.boot.demo.bootlesson1.user.entity.dm.Department;
import com.xmg.boot.demo.bootlesson1.user.entity.dm.DepartmentVo;
import com.xmg.boot.demo.bootlesson1.user.entity.dm.Employee;
import com.xmg.boot.demo.bootlesson1.user.service.dm.impl.DepartmentServiceImpl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 微信搜一搜：贺贺学编程
 * @since 2023-11-29
 */
@Mapper
@Component
public interface DepartmentMapper extends BaseMapper<Department> {
    public List<Department> findDepartmentAll();

    //直接用mapper测试，没有方法实现
    @DS("db_dm8")
    List<Department> findByDpId(int id);

    List<Department> findByCondition(@Param(Constants.WRAPPER) LambdaQueryWrapper<Department> queryWrapper);

    List<DepartmentVo> findByVo();

    @DS("db_dm8")
    List<Department> selectProc(@Param("departmentId") int departmentId);

//    @DS("db_dm8")
//    List<List<?>> selectProcAll(@Param("departmentId") int departmentId);

//    @SelectProvider(type = DepartmentServiceImpl.class, method = "getEmployeeInfo")
//    List<Map<String,Object>> getEmployeeInfo(int departmentId);
}
